//
//  ShoppingCartModel.swift
//  CJXSwiftStoryboard
//
//  Created by CJX on 2016/10/22.
//  Copyright © 2016年 caijianxi. All rights reserved.
//

import UIKit

class ShoppingCartModel: NSObject {
    
    var products_image : String?
    var products_name : String?
    
    var products_options_values_name : String?
    var options_values_id : String?
    var options_id : String?
    
    
    var format_price : String?
    var format_total_price : String?
    var quantity : String?
    var products_id : String?
    var id : String?
    
    
    init(dictionary:NSDictionary){
        products_image = dictionary["products_image"]as?String
        products_name = dictionary["products_name"]as?String
        let arr = dictionary["attributes"] as? NSArray
        
        products_options_values_name = arr!.firstObject!["products_options_values_name"] as? String
        options_values_id = String((arr!.firstObject!["options_values_id"]!)!)
        options_id = String((arr!.firstObject!["options_id"]!)!)
        
        format_price = dictionary["format_price"]as?String
        format_total_price = dictionary["format_total_price"]as?String
        quantity = String(dictionary["quantity"]!)
        products_id = String(dictionary["products_id"]!)
        id = dictionary["id"]! as? String
        
    }

}
